﻿'Imports EnvDTE, System.Windows.Forms

' ''' <summary>
' ''' REMOVE THIS AS SOON AS POSSIBLE
' ''' </summary>
' ''' <remarks></remarks>
' ''' <features></features>
' ''' <stepthrough></stepthrough>
'<Obsolete("Remove ASAP", False)>
'Friend Class ViewController
'    Public Sub New(ByVal view As VsToolWindow)
'        VsToolWin = view
'    End Sub

'    'Private Sub View_RunIntrudingMethod(ByVal sender As Object, ByVal e As ToolWindowControl.RunIntrudingMethodEventArgs)


'    '    If Mod_Utilities.DTE.Debugger.CurrentMode <> dbgDebugMode.dbgBreakMode Then
'    '        MessageBox.Show("You have to be inside a debugging session to inject intruding methods", "Not Possible", MessageBoxButtons.OK, MessageBoxIcon.Information)
'    '        Return
'    '    End If


'    '    'RaiseEvent RunIntrudingMethod(sender, e)
'    '    'If RunIntrudingMethod IsNot Nothing Then
'    '    '    RunIntrudingMethod.Invoke(sender, e)
'    '    'End If
'    'End Sub

'    'Private Sub View_QueryContextType(ByVal sender As Object, ByVal e As ToolWindowControl.QueryContextTypeEventArgs)
'    '    'if (QueryContextType != null)
'    '    '    QueryContextType.Invoke(sender, e);
'    'End Sub

'    '<Obsolete("Remove ASAP", True)>
'    'Public Event RunIntrudingMethod As EventHandler(Of ToolWindowControl.RunIntrudingMethodEventArgs)
'    <Obsolete("Remove ASAP", True)>
'    Public Event QueryContextType As EventHandler(Of ToolWindowControl.QueryContextTypeEventArgs)

'    Private Property VsToolWin As VsToolWindow
'    <Obsolete("Remove ASAP", True)>
'    Private ReadOnly Property View() As ToolWindowControl
'        Get
'            If VsToolWin Is Nothing Then
'                Return Nothing
'            End If
'            Return VsToolWin.Control
'        End Get
'    End Property

'    '<Obsolete("Remove ASAP", True)>
'    'Public Function Connect() As Boolean
'    '    If View Is Nothing Then
'    '        Return False
'    '    End If

'    '    AddHandler View.RunIntrudingMethod, New EventHandler(Of ToolWindowControl.RunIntrudingMethodEventArgs)(
'    '        Sub()
'    '            If Mod_Utilities.DTE.Debugger.CurrentMode <> dbgDebugMode.dbgBreakMode Then
'    '                MessageBox.Show("You have to be inside a debugging session to inject intruding methods", "Not Possible", MessageBoxButtons.OK, MessageBoxIcon.Information)
'    '                Return
'    '            Else
'    '                System.Diagnostics.Debugger.Break()
'    '            End If

'    '        End Sub)
'    '    'AddHandler View.QueryContextType, New EventHandler(Of ToolWindowControl.QueryContextTypeEventArgs)(Sub(x, y) RaiseEvent QueryContextType(x, y))



'    '    AddHandler View.Connect, New EventHandler(Sub() RaiseEvent QueryConnect(Me, EventArgs.Empty))


'    '    AddHandler View.QueryContextType, New EventHandler(Of ToolWindowControl.QueryContextTypeEventArgs)(
'    '        Sub(sender As Object, e As ToolWindowControl.QueryContextTypeEventArgs)
'    '            If Mod_Utilities.DTE.Debugger.CurrentMode <> dbgDebugMode.dbgBreakMode Then
'    '                Return
'    '            End If

'    '            e.ContextType = Mod_Utilities.GetContextType()
'    '        End Sub)





'    '    'View.RunIntrudingMethod += New EventHandler(Of ToolWindowControl.RunIntrudingMethodEventArgs)(AddressOf View_RunIntrudingMethod)
'    '    'View.QueryContextType += New EventHandler(Of ToolWindowControl.QueryContextTypeEventArgs)(AddressOf View_QueryContextType)
'    '    'View.Connect += New EventHandler(AddressOf View_Connect)
'    '    Return True
'    'End Function

'    <Obsolete("Remove ASAP", True)>
'    Friend Event QueryConnect As EventHandler

'    'Private Sub View_Connect(ByVal sender As Object, ByVal e As EventArgs)
'    '    RaiseEvent QueryConnect(Me, EventArgs.Empty)
'    '    'If QueryConnect IsNot Nothing Then
'    '    '    QueryConnect.Invoke(Me, EventArgs.Empty)
'    '    'End If
'    'End Sub


'    ''' <summary>
'    ''' Code <code>View.Invoke(Sub() View.SetContextType(contextType))</code>
'    ''' </summary>
'    ''' <param name="contextType"></param>
'    ''' <remarks></remarks>
'    ''' <stepthrough></stepthrough>
'    <Obsolete("Replace With View.SetContextType(contextType)", True)>
'    Public Sub SetContextType(ByVal contextType As Type)
'        'Dim setContextTypeAction As Action = Function() View.SetContextType(contextType)
'        'Dim setContextTypeAction As Action = Sub() View.SetContextType(contextType)

'        View.Invoke(Sub() View.SetContextType(contextType))
'    End Sub

'    <Obsolete("Replace With   View.TellExecutionFailed(message)", True)>
'    Friend Sub TellExecutionFailed(ByVal message As String)
'        View.TellExecutionFailed(message)
'    End Sub

'    <Obsolete("Replace With  View.DisplayResultExpression(expression)", True)>
'    Friend Sub DisplayResultExpression(ByVal expression As Expression)
'        View.DisplayResultExpression(expression)
'    End Sub
'End Class